package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Label;
import cn.wolfcode.trip.base.mapper.LabelMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.ILabelService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LabelServiceImpl implements ILabelService {
    @Autowired
    private LabelMapper labelMapper;

    @Override
    public List<Label> getModelLabel() {
        return labelMapper.getModelLabel();
    }

    @Override
    public PageInfo getLabelsByStrategyId(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),qo.getOrderBy());
        List<Label> list = labelMapper.getLabelsByStrategyId(qo);
        return new PageInfo<>(list);
    }
}
